/**
 * A9组件库
 */

import { VueConstructor } from 'vue/types/umd'

import Audio from './audio/index.vue'
import Button from './button/index.vue'
import Calendar from './calendar/index.vue'
import Chat from './chat/index.vue'
import Swipe from './swipe/index.vue'
import Video from './video/index.vue'
import NoticeBar from './notice-bar/index.vue'
import ActionSheet from './action-sheet/index.vue'
import Picker from './picker/index.vue'
import NavBar from './nav-bar/index'
import Progress from './progress/index'
import Divider from './divider/index.vue'
import Skeleton from './skeleton/index'

const components = [
  Audio,
  Button,
  Calendar,
  Chat,
  Swipe,
  Video,
  NoticeBar,
  ActionSheet,
  Picker,
	NavBar,
	Progress,
	Divider,
	Skeleton
]

const install = function (Vue: VueConstructor) {
  components.forEach(component => {
	  Vue.component(component.name, component)
  })
}

if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}

export {
  Audio,
  Button,
  Calendar,
  Chat,
  Swipe,
  Video,
  NoticeBar,
  ActionSheet,
  Picker,
	NavBar,
	Progress,
	Divider,
	Skeleton
}

export default {
  install
}
